package cn.itcast.bos.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import cn.itcast.bos.dao.base.BaseDaoImpl;
import cn.itcast.bos.domain.Function;

@Repository
public class FunctionDaoImpl extends BaseDaoImpl<Function> implements IFunctionDao {

	@Override
	public List<Function> findFunctionByUserId(String id) {
		String hql = "from Function f left outer join fetch " +
				"f.roles r left outer join fetch r.users u where u.id = ?";
		return this.getHibernateTemplate().find(hql, id);
	}

}
